﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WanPiJie.WebSite._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>顽皮街—为你发现宝宝的喜欢</title>
	<meta name="keywords" content="顽皮街 发现喜欢 买奶粉 买奶瓶 买奶嘴 买尿不湿 买纸尿裤" />
	<meta name="description" content="顽皮街，为宝宝的成长提供最贴心的指导，记录宝宝的成长点滴，分享亲子购物的乐趣。" />
	<link href="http://static.wanpijie.com/styles/global.css" rel="stylesheet" type="text/css" />
	<link href="http://static.wanpijie.com/styles/www.css" rel="stylesheet" type="text/css" />
	<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.min.js" type="text/javascript"></script>
	<script src="http://static.wanpijie.com/scripts/jquery.cookie.min.js" type="text/javascript"></script>
	<script src="http://static.wanpijie.com/scripts/global.js" type="text/javascript"></script>
	<script type="text/javascript" src="Scripts/site.js"></script>
	<script type="text/javascript">
		var catalogId = '<%= this.CatalogId %>';

		//动态加载商品信息
		function loading() {
			loader.skip = <%= this.PageSize %>;
			if(loader.enable)
			{
				loader.loading("Commodity/Loader.aspx", { sp:loader.skip,cid: catalogId, pno: loader.pageIndex, r: Math.random() });
				loader.pageIndex++;
			}
		}

		/*追加内容*/
		function append(commodities) {
			if(commodities.length==0)
			{
				$("#bottomTips").html("没有更多商品");
				return;
			}
			var boxs=$("#pdt-list");
			var li;
			for(var i	in commodities)
			{
				li=$("<li></li>");
				li.bind("mousemove",function()
				{
					changeBorderColor(this,'#FF6600');
				});
				li.bind("mouseout",function(){
					changeBorderColor(this,'#CCCCCC');
				});
				if(i%4==0)
				{
					li.addClass("box	first");
				}
				else
				{
					li.addClass("box");
				}
				this.appendContent(commodities[i],li);
				boxs.append(li);
			}
		}

		/*追加内容*/
		function appendContent(commodity,li) {
			var imgUrl="http://static.wanpijie.com/Pdt/"+commodity.catalogId+"/"+commodity.serialNumber+"/168-168.jpg";
			var detailUrl="Commodity/Detail.aspx?ItemId="+commodity.serialNumber;
			li.append('<a href="'+detailUrl+'" target="_blank" title="'+commodity.title+'" ><img src="'+imgUrl+'" width="168px" height="168px" alt="'+commodity.title+'" /></a>');
			li.append('<ul class="attribute"><li class="trade-num" title="月销量：'+commodity.volume+'件">♥'+commodity.volume+'</li><li class="price">￥'+commodity.price+'</li></ul>');
			li.append('<span><a href="'+detailUrl+'" target="_blank">'+commodity.title+'</a></span>');
		}

		function changeBorderColor(_this, color) {
			_this.style.borderColor = color;
		}

		$(window).bind("scroll", function (_event) {
			if ($(window).scrollTop() >= $(document).height() - $(window).height()) 
			{
				window.loading();
			}
			_event.stopPropagation();
		});
	</script>
	<style type="text/css">
		ul.pdt-catalog
		{
			margin-top: 10px;
		}
		
		.remind
		{
			overflow: hidden;
		}
		
		.remind .intro, .social li
		{
			float: left;
			height: 40px;
			line-height: 36px;
		}
		
		.remind .intro
		{
			width: 780px;
			padding-left: 20px;
		}
		
		.social
		{
			float: right;
			padding-left: 5px;
		}
		
		.social li
		{
			width: 80px;
			padding-left: 6px;
		}
		
		.social img
		{
			float: left;
		}
		
		.social .weibo img
		{
			width: 30px;
			height: 30px;
			margin-top: 4px;
		}
		
		.social .tqq img
		{
			width: 25px;
			height: 25px;
			margin-top: 8px;
		}
		
		.social em
		{
			display: block;
			float: left;
			height: 100%;
			line-height: 40px;
			margin-left: 8px;
			font-style: normal;
		}
		
		.more
		{
			text-align: center;
			font-size: 16px;
			line-height: 36px;
			margin-top: 10px;
		}
		
		.more a
		{
			display: block;
			width: 100%;
		}
	</style>
	<script language="c#" runat="server">
		int x = 0;

		string GetCatalogStatusCss(int catalogId)
		{
			return catalogId == this.CatalogId ? "active" : "";
		}
	</script>
</head>
<body>
	<form id="form1" runat="server">
	<wpj:SiteHeader ID="SiteHeader" runat="server" />
	<div class="wrap" id="mainContent">
		<div class="remind">
			<div class="b intro">
				那些宝宝们最爱的东西，都在这里......
			</div>
			<ul class="social">
				<li class="b weibo"><a href="http://weibo.com/wanpijie" target="_blank">
					<img src="http://static.wanpijie.com/images/icon-weibo.png" alt="" />
					<em>关注</em></a></li>
				<li class="bt br bb tqq"><a href="http://t.qq.com/wanpij" target="_blank">
					<img src="http://static.wanpijie.com/images/icon-tqq.jpg" alt="" />
					<em>收听 </em></a></li>
			</ul>
		</div>
		<ul class="pdt-catalog">
			<li><a href="Default.aspx" class="<%= this.GetCatalogStatusCss(0) %>">发现</a> </li>
			<li><a href="Default.aspx?cid=1" class="<%= this.GetCatalogStatusCss(1) %>">奶粉 </a></li>
			<li><a href="Default.aspx?cid=2" class="<%= this.GetCatalogStatusCss(2) %>">奶瓶</a></li>
			<li><a href="Default.aspx?cid=3" class="<%= this.GetCatalogStatusCss(3) %>">奶嘴</a></li>
			<li><a href="Default.aspx?cid=4" class="<%= this.GetCatalogStatusCss(4) %>">纸尿裤</a></li>
		</ul>
		<ul id="pdt-list" class="box-list index-pdt-list">
			<asp:Repeater ID="rptProductList" runat="server">
				<ItemTemplate>
					<li onmousemove="changeBorderColor(this,'#FF6600');" onmouseout="changeBorderColor(this,'#CCCCCC');" class="box <%= (++x % 4 == 1 ? "first" : "") %>">
                        <a title="<%# Eval("Title")%>" href="Commodity/Detail.aspx?ItemId=<%# Eval("SerialNumber") %>" target="_blank">
						<img src="http://static.wanpijie.com/Pdt/<%#Eval("CatalogId")%>/<%# Eval("SerialNumber")%>/168-168.jpg" width="168px" height="168px" alt="<%# Eval("Title")%>" />
					</a>
						<ul class="attribute">
							<li class="trade-num" title="月销量：<%# Eval("Volume") %>件">♥
								<%# Eval("Volume") %></li>
							<li class="price">￥<%# Eval("Price") %></li>
						</ul>
						<span><a href="Commodity/Detail.aspx?ItemId=<%# Eval("SerialNumber") %>" target="_blank">
							<%# Eval("Title") %></a> </span></li>
				</ItemTemplate>
			</asp:Repeater>
		</ul>
		<div class="more b link2">
			<span class="link2" id="bottomTips">正在加载…</span>
			<%--<a href="javascript:loading();" class="link2">点击更多…</a>--%>
		</div>
	</div>
	<wpj:SiteFooter ID="SiteFooter" runat="server" />
	</form>
	<script src="http://a.tbcdn.cn/apps/top/x/sdk.js?appkey=21113056" type="text/javascript"></script>
</body>
</html>
